﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CZBK.ShopHeima2.IDAL
{
    public interface IBaseRepository<T> where T:class,new()
    {

        #region 查询和分页
        IEnumerable<T> LoadAllEntities(Func<T, bool> whereLambda);

        IEnumerable<T> LoadAllPageEntities<S>(int pageIndex, int pageSize, Func<T, bool> whereLambda, Func<T, S> orderByLambda, bool asc);
        
        #endregion

        #region cud
        T AddEntity(T entity);

        bool UpdateEntity(T entity);
        bool DeleteEntity(int id); 
        #endregion
    }
}
